package za.org.jcicada.cfgmngr.impl;

import java.net.URISyntaxException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.commons.logging.LogFactory;

import za.org.jcicada.confss.impl.ConfssDynamicConfiguration;
import za.org.jcicada.genss.SystemURN;

public class CfgMngrDynamicConfiguration extends ConfssDynamicConfiguration {
	private Set<SystemURN> systemURNs;
	public String systemCountStatusStrategy = "Int:0=>WARN,65535=>NOMINAL";
	public String sensorCountStatusStrategy = "Int:0=>WARN,65535=>NOMINAL";
	public List<String> enabledSystemNames;
	public Set<SystemURN> getEnabledSystemURNs() {
		if (systemURNs == null) {
			systemURNs = new HashSet<SystemURN>();
			for (String systemName : enabledSystemNames) {
				try {
					systemURNs.add(new SystemURN(systemName));
				} catch (URISyntaxException e) {
					LogFactory.getLog(CfgMngrDynamicConfiguration.class).error(e);
				}
			}
		}
		return systemURNs;
	}
}
